from flask import Blueprint, render_template, url_for
import qrcode

bp = Blueprint("main", __name__)


@bp.route("/")
@bp.route('/index.do')
def index():
    # print(url_for("static", filename="css/bootstrap.min.css"))
    # return "1"
    # return url_for("css/bootstrap.min.css")
    # return render_template("index.html")
    return render_template("blank_page-working.html")


@bp.route('/test')
def test():
    # print(url_for("static", filename="css/bootstrap.min.css"))
    # return "1"
    # return url_for("css/bootstrap.min.css")
    return render_template("blank_page-working.html") \
 \
 \
@bp.route('/qrcode')
def qrcode():
    qr = qrcode.QRCode(version=5, error_correction=qrcode.constants.ERROR_CORRECT_H, box_size=8, border=4, )
    qr.add_data('xinxingzhao')
    qr.make(fit=True)
    img = qr.make_image()
    img.save('xinxingzhao.png')
    return render_template("blank_page-working.html")
